<template>
    <div v-if="row.actions.length>2">
        <a @click="tableHandleClick(row, row.actions[0])">{{ row.actions ? row.actions[0].label : '' }}</a>
        <Divider type="vertical" />
        <Dropdown @on-click="(name) => handleClickMore(name, index, row)"
                  transfer>
            <a>更多
                <Icon type="ios-arrow-down" /></a>
            <DropdownMenu slot="list">
                <DropdownItem v-for="(item, i) in row.actions.slice(1)"
                              :key="i"
                              :name="item.name">{{ item.label }}</DropdownItem>
            </DropdownMenu>
        </Dropdown>
    </div>
    <div v-else>
        <a v-if="row.actions"
           @click="tableHandleClick(row, row.actions[0])">{{ row.actions[0].label }}</a>
        <Divider v-if="row.actions && row.actions.length>1"
                 type="vertical" />
        <a v-if="row.actions && row.actions.length>1"
           @click="tableHandleClick(row, row.actions[1])">{{ row.actions[1].label }}</a>
    </div>
</template>
<script>

    import dynamictableactions from '@/mixins/dynamictableactions'; // 混入通用代码
    export default {
        mixins: [
            dynamictableactions
        ],
        data () {
            return {
            }
        }
    }
</script>
